<template>
	<view>
		<view class="TexyTop">您当前的订单为：</view>
		<uni-table emptyText="暂无更多数据">
			<!-- 表头行 -->
			<uni-tr>
				<uni-th align="center">订单号</uni-th>
				<uni-th align="center">总价格</uni-th>
				<uni-th align="left">购买人</uni-th>
				<uni-th align="left">操作</uni-th>
			</uni-tr>
			<!-- 表格数据行 -->
			<uni-tr>
				<uni-td>1111</uni-td>
				<uni-td>10</uni-td>
				<uni-td>111</uni-td>
				<uni-td>
					<button class="uni-button" size="mini" type="primary" @click="isshow=!isshow">查询</button>
					<button class="uni-button" size="mini" type="warn">评价</button>
				</uni-td>
			</uni-tr>
		</uni-table>
		<uni-list-chat v-if="isshow" title="uni-app"
			avatar="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" badge-positon="left">
			<view class="chat-custom-right">
				<text class="chat-custom-text">数量1</text>
			</view>
		</uni-list-chat>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isshow: false
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			getData() {
				uni.request({
					url: 'http://192.168.137.23:8002/admin/userorders?username=liying',
					method: 'GET',
					success(res) {
						console.log(res);
					}
				})
			}
		}
	}
</script>

<style>
	.TexyTop {
		width: 100%;
		height: 2rem;
		font-size: 24px;
		font-weight: bold;
	}

	.chat-custom-right {
		flex: 1;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		justify-content: space-between;
		align-items: flex-end;
	}

	.chat-custom-text {
		font-size: 12px;
		color: #999;
	}
</style>